package test2;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import Tools.time;
import greyLangCppApi.windowApi;

public class Main {
	public static String logPath=Tools.File.getPath()+"\\cfg\\logs\\"+time.getDay()+"-"+time.getHour()+"-"+time.getMinute()+"-"+time.getSecond()+".txt";
	public static Map<String,Var> varList=new HashMap<String,Var>();//变量表
	public static String programPath=Tools.File.getPath();
	public static String fileName="test.gs";
	public static String greyLangPath=Tools.File.getPath();
	public static void main(String[] args) throws IOException {
		System.setProperty("jna.encoding","GBK");//神奇的魔幻代码
		File file = new File(logPath);
		file.createNewFile();
		String script=Tools.File.readFile_string(Tools.File.getPath()+"\\test.gs");
		ArrayList<parser.Word> word=parser.parserWord.analysis(script);
		File file1 = new File(Tools.File.getPath()+"\\cfg\\words.json");
		file1.createNewFile();
		Tools.File.writeFile_text(Tools.File.getPath()+"\\cfg\\words.json",Tools.greyLang.test_printWord(word));
		run.run(word,parser.cfg.MODE_COMMON);
		//System.out.println(Tools.greyLang.test_printVar(varList));
		System.exit(0);
	}
}
